#include "Condition.h"

Condition::Condition()

{
	pthread_mutex_init(&this->mutex, NULL);
	pthread_cond_init (&this->condition, NULL);
}

Condition::~Condition()
{
	pthread_mutex_destroy(&this->mutex);
	pthread_cond_destroy(&this->condition);
}

void Condition::wait(){
	pthread_cond_wait(&this->condition, &this->mutex);
}
void Condition::signal(){
	pthread_cond_signal(&this->condition);
}

int Condition::mutexLock(){
	return pthread_mutex_lock(&this->mutex);
}

int Condition::mutexUnlock(){
	return pthread_mutex_unlock(&this->mutex);
}
